﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<ShareB.Models.MetaFieldModel>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	ManageFields
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>ManageFields</h2>

    <table>
        <tr>
            <th> Options </th>
            <th>
                MetaFieldID
            </th>
            <th>
                FieldName
            </th>
            <th>
                FieldType
            </th>
            <th>
                Locked
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <% if (!item.Locked)
                   { %> 
                    <%: Html.ActionLink("Edit", "EditMeta", new { id=item.MetaFieldID })%>
                <% }
                   else
                   { %>
                    Cannot be modified
                 <%} %>
            </td>
            <td>
                <%: item.MetaFieldID %>
            </td>
            <td>
                <%: item.FieldName %>
            </td>
            <td>
                <%: item.FieldType %>
            </td>
            <td>
                <%: item.Locked %>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%: Html.ActionLink("Create New", "CreateMeta") %>
    </p>

</asp:Content>

